package com.situation.service;


import com.github.pagehelper.PageInfo;
import com.situation.pojo.DO.TbMenu;
import com.situation.pojo.DO.TbRole;
import com.situation.pojo.DO.TbUser;
import com.situation.pojo.DO.TbUserRole;
import com.situation.pojo.VO.MenuNodeVO;
import com.situation.pojo.VO.UserRoleVO;
import com.situation.pojo.VO.UserVO;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.PrintWriter;
import java.util.List;

public interface TbUserService {

//    /***
//    * @Description: 添加用户
//    * @Param: [tbUser]
//    * @return: int
//    * @Author: 赵启岸
//    * @Date: 2021/12/7
//    */
    int addTbUser(TbUser user);

    /***
     * @Description: 通过id删除用户
     * @Param: [id]
     * @return: int
     * @Author: 赵启岸
     * @Date: 2021/12/7
     */
    int deleteTbUser(Long id);

    /***
     * @Description: 通过id修改用户
     * @Param: [tbUser]
     * @return: int
     * @Author: 赵启岸
     * @Date: 2021/12/7
     */
    int updateTbUser(TbUser tbUser);

    /***
     * @Description: 通过id查询vo用户
     * @Param: [id]
     * @return: com.situation.pojo.DO.TbUser
     * @Author: 赵启岸
     * @Date: 2021/12/7
     */
    UserVO queryUserVoById(Long id);

    /***
     * @Description: 查询所有vo用户
     * @Param: []
     * @return: java.util.List<com.situation.pojo.DO.TbUser>
     * @Author: 赵启岸
     * @Date: 2021/12/7
     */
    List<UserVO> queryAllUserVo();

    /***
     * @Description: 查询所有数据库用户
     * @Param: []
     * @return: java.util.List<com.situation.pojo.DO.TbUser>
     * @Author: 赵启岸
     * @Date: 2021/12/7
     */
    List<TbUser> findAllTbUser();

    /***
     * @Description: 用户分页
     * @Param: [pageNum, pageSize]
     * @return: com.github.pagehelper.PageInfo<com.situation.pojo.VO.UserVo>
     * @Author: 赵启岸
     * @Date: 2021/12/8
     */
    PageInfo<UserVO> page(int pageNum, int pageSize);

    /***
     * @Description: 查询菜单
     * @Param: [tbUser]
     * @return: java.util.List<com.situation.pojo.DO.TbMenu>
     * @Author: 赵启岸
     * @Date: 2021/12/8
     */
    List<MenuNodeVO> findMenu();

    /***
     * @Description: 多条件模糊查询
     * @Param: [userVo]
     * @return: com.github.pagehelper.PageInfo<com.situation.pojo.VO.UserVo>
     * @Author: 赵启岸
     * @Date: 2021/12/8
     */
    PageInfo<UserVO> findUserList(TbUser tbUser, int pageNum, int pageSize);

    /***
     * @Description: 查询用户登入信息
     * @Param: [tbUser]
     * @return: com.situation.pojo.VO.UserRoleVo
     * @Author: 赵启岸
     * @Date: 2021/12/8
     */
    UserRoleVO userInfo();


    /***
     * @Description: 给指定id用户添加权限
     * @Param: [tbUserRole]
     * @return: int
     * @Author: 赵启岸
     * @Date: 2021/12/8
     */
    int addTbUserRole(Long id, List<Long> ids);

    /***
     * @Description: 通过用户id查询现有角色
     * @Param: [id]
     * @return: com.situation.pojo.DO.TbRole
     * @Author: 赵启岸
     * @Date: 2021/12/8
     */
    List<TbRole> findRoleById(Long id);


    /**
     * 登录
     *
     * @param username
     * @param password
     * @return
     */
    TbUser login(String username, String password);


    int updateStatus(Long id, int status);



}
